package com.example.score.service;

import com.example.score.entity.TUser;
import com.example.score.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    public int inserts(List<TUser> list) {
        return  userMapper.inserts(list);
    }

    public int insertsauthority(List<TUser> list){
        return userMapper.insertsauthority(list);
    }

    public TUser getTUserByUsername(String username) {
        return userMapper.getTUserByUsername(username);
    }
    public List<TUser> getList() {
        return userMapper.getList();
    }

    public Integer register(TUser list){
        userMapper.register(list);
        int success = userMapper.registAuthority(list);
        return success;
    }
    public TUser getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    public Integer logout(List<Integer>list){
        userMapper.logout(list);
        int QAQ = userMapper.logout2(list);
        return QAQ;
    }

}
